UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R3m2k4QmZ23LMIRNcAOIWouj/O+fKD7yZXXy3Zf7gns='
WHERE
key_id = '0edfbb4e7f0667fd306c29860661aa495322eca69a8f3be45490913e4c22af68'
AND (
token = 'R3m2k4QmZ23LMIRNcAOIWouj/O+fKD7yZXXy3Zf7gns='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)