UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'siq3RUZiqcQdiHIK8IL7escp3MdPBar9oCmjSUhmJMA=' 
WHERE 
  key_id = 'e2812b0f97d1952c1aa31287013cbc10cd359b907ecc5a4e53f019cdaaceff39' 
  AND (
    token = 'siq3RUZiqcQdiHIK8IL7escp3MdPBar9oCmjSUhmJMA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041