UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ScRS+TpXBgYpAbFM62Gx/6jTEFZs4Os+zKMD7dqH8wU='
WHERE
key_id = '00004a34a4a67076c99f4325b040e2c5dd2f6f7c6fc52b83e068c4dceb6ae848'
AND (
token = 'ScRS+TpXBgYpAbFM62Gx/6jTEFZs4Os+zKMD7dqH8wU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)