UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2jPiMHS4SgN6R92uX/lsXDhyUo1jI9xffOz8fjmOjAk='
WHERE
key_id = '6c93266c8abc8f6e9433829a0bb9304cfcf53f81ff8deab75a6f3d407822d937'
AND (
token = '2jPiMHS4SgN6R92uX/lsXDhyUo1jI9xffOz8fjmOjAk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)