UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xla3SZU3F46FibBlSVX271EHPTfCrG6pXIfK7VC7Hog='
WHERE
key_id = '3adc7e6f3c877e24039a56e9b7aa698ab32021fa52b5fd0260e925e6a9d30f7c'
AND (
token = 'xla3SZU3F46FibBlSVX271EHPTfCrG6pXIfK7VC7Hog='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)