UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'J7q6lCsf7Fdzg1J/iXDnqKodyt8pY/vC1rYGIdAsli4='
WHERE
key_id = '41469c1fbe9ecd597d4dcb7cb52ee491a12dc09815ce8a5f92a4e6f9dd92bb4f'
AND (
token = 'J7q6lCsf7Fdzg1J/iXDnqKodyt8pY/vC1rYGIdAsli4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)