UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RjUSl/YNDqazmx89bSJkYdpTGu2dZVEp/dfeCCUZolE=' 
WHERE 
  key_id = '351d562a288d408e99df6b403682c5ac874b0b08319d1120e084daf601cf9219' 
  AND (
    token = 'RjUSl/YNDqazmx89bSJkYdpTGu2dZVEp/dfeCCUZolE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030