UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xRU/ql61sQFtMuXWNxoyqHHond3lSqOENtzauQqy8+k='
WHERE
key_id = 'ba81aef80e9590cfd302629114e81505be52189c3b92eccf4c947d8ca2bdda17'
AND (
token = 'xRU/ql61sQFtMuXWNxoyqHHond3lSqOENtzauQqy8+k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)