UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OyP1c19pMBpOSfRF1foZWCErMbbWfM+RZR/gliVwj3Q='
WHERE
key_id = '554804618de60927bb2256a5219698e596a0e387ef3766b0a8f0d68c15f95db4'
AND (
token = 'OyP1c19pMBpOSfRF1foZWCErMbbWfM+RZR/gliVwj3Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)