UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PNLHoAvOWj6aAfICbXfi0Ze/6rOQzUE9Qc62dPsljLY=' 
WHERE 
  key_id = '3e9d981de48aeae67ea6b2064571916da55c08e8be9258047f7d7f63111b9bf7' 
  AND (
    token = 'PNLHoAvOWj6aAfICbXfi0Ze/6rOQzUE9Qc62dPsljLY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024