UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'E5dyNFb/9cK1BDKrVmRv05zgqh+Z+Q4WXgmbeaR+x4E=' 
WHERE 
  key_id = '4a59d44a18213a1548398a70a85dfba6922d739faf0ad0bc9926cdd434319fff' 
  AND (
    token = 'E5dyNFb/9cK1BDKrVmRv05zgqh+Z+Q4WXgmbeaR+x4E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017