UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '24ZWyX74SU46mHQaUzC/w5YbWkbUWYYs6CTsTTzhuQs=' 
WHERE 
  key_id = '37041fafba7d8516c9d2f0af98626fc3d1c4e99783b3aa4b6a6a548e9677b4b8' 
  AND (
    token = '24ZWyX74SU46mHQaUzC/w5YbWkbUWYYs6CTsTTzhuQs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036