UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HCVaq7hQQns4AW1G3EQmuV6RpGK0c1tkpIpM7P6KBCM=' 
WHERE 
  key_id = '60852b003397b05b304bd08e22fc7b48e6b700b698043621ce1c57f649ee9485' 
  AND (
    token = 'HCVaq7hQQns4AW1G3EQmuV6RpGK0c1tkpIpM7P6KBCM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043