UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kO/POw7Nq22Lk5AeeUNKaevE7ooflLR9dhuVMybJbAk='
WHERE
key_id = '8f78da6c15a5249e27350f58208fb2b5b040a3ab79a9fede0e4350cecaa64f35'
AND (
token = 'kO/POw7Nq22Lk5AeeUNKaevE7ooflLR9dhuVMybJbAk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)