UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F6Vgl0v0ZFJ/njUgVHLHpqGfymoXPmOF1oAKTt5Kjso=' 
WHERE 
  key_id = '64d960efb1fa5377608e44f813b3fe2426aa30ca3dcd8dad02bf40d62cba0b6d' 
  AND (
    token = 'F6Vgl0v0ZFJ/njUgVHLHpqGfymoXPmOF1oAKTt5Kjso=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026