UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FBnvESeBtRTnYd3PMUS2SSV5O2s2gfTaJxe7Svun1PI=' 
WHERE 
  key_id = '575c34691192b3c9c561d7cc8a850138de0ff74efb896496396697152f02210f' 
  AND (
    token = 'FBnvESeBtRTnYd3PMUS2SSV5O2s2gfTaJxe7Svun1PI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043