UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'n25clZyZJdhpwhrGaQ3C/ete9VTRH30NsDYhMxkIN30=' 
WHERE 
  key_id = '54b7bc7c5959e5ac624c5dc8127dadf8e2f6d35ccf81ea9fc8db044386e2fedc' 
  AND (
    token = 'n25clZyZJdhpwhrGaQ3C/ete9VTRH30NsDYhMxkIN30=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022