UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hyu2greh0LBZYsmF68vnielIXYP1vcrwOMs7najFN8k=' 
WHERE 
  key_id = '3c02a9d05fbeaa947d6cf9b185cb3aec6e7f525ecc88b88ee13a8f6785feae5c' 
  AND (
    token = 'hyu2greh0LBZYsmF68vnielIXYP1vcrwOMs7najFN8k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022