UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/kBOC/A6zIvwtjijT4ps3oH9PrBxgbk4AoFsrMlEwo8='
WHERE
key_id = 'c0ce0b8542b218494b127a3cb915e280c65b6cdd5f47d912f70740bbfaf98a39'
AND (
token = '/kBOC/A6zIvwtjijT4ps3oH9PrBxgbk4AoFsrMlEwo8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)