UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6DqCT140ALelCETd2+6/F+yOyh5VooftBISfSb0nPtQ=' 
WHERE 
  key_id = '490c0fdb1850eb30a740480f71c4889dfbee02695adb02f5e7539556b8f272bb' 
  AND (
    token = '6DqCT140ALelCETd2+6/F+yOyh5VooftBISfSb0nPtQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023