UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WcqzYI3RGl+GGTrfysaTTDouQ01ShSDOVT8icd0s1I8='
WHERE
key_id = '79e9fe0e5adc509d0940eff95f416c26e8e60c483d475cdff737c8bea34b0a25'
AND (
token = 'WcqzYI3RGl+GGTrfysaTTDouQ01ShSDOVT8icd0s1I8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)