UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8PY2b0pF0Wn7ul2rBCNeV0GZT9IsphhSagPICM7TShw=' 
WHERE 
  key_id = 'c3b5eecf733ce97183e5bf189a02b0b13bb6be6ed17eff31cb2335eddfba3e73' 
  AND (
    token = '8PY2b0pF0Wn7ul2rBCNeV0GZT9IsphhSagPICM7TShw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025