UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aQVFsQP+/FLMzLl0IAihT2Lrei2JJwvThsk32vwEEJA='
WHERE
key_id = 'ef40ac372f7fac44aaecfce5391bef7ea8ffd7c51c9055691022f2d77d70f169'
AND (
token = 'aQVFsQP+/FLMzLl0IAihT2Lrei2JJwvThsk32vwEEJA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)