UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pkBLM5MA8eaV7/j/afu7F0MMykdNlznLI4iR+2tLYdY=' 
WHERE 
  key_id = '633f0496339d0a0adccc10d3346371c1e5b89cf0fc8cfd7b5b2833dae9624d92' 
  AND (
    token = 'pkBLM5MA8eaV7/j/afu7F0MMykdNlznLI4iR+2tLYdY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037