UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZnGfq88N5KEEH8ZkWOtP/hvcPjh3okKiw5ws5eRWMfE=' 
WHERE 
  key_id = '98a859ba430e6d5559ca0b4d2d20bf5104ba5f4729639a392dca96cdd7fd1457' 
  AND (
    token = 'ZnGfq88N5KEEH8ZkWOtP/hvcPjh3okKiw5ws5eRWMfE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048