UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LeawGY3o/zhUuvZj74zkU1FcvrGN/Q2mY/eLiQH5Gls=' 
WHERE 
  key_id = '874750be72f972a9b8fc4247437c2467db7622deb24be145cb875af54ed35c5b' 
  AND (
    token = 'LeawGY3o/zhUuvZj74zkU1FcvrGN/Q2mY/eLiQH5Gls=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030