UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1bKOc3S+ccvVMZRC7IuX+0yKoL3ooNOLz2vIscghKrc='
WHERE
key_id = '3d074ca1e3da5a36d23c3cafa61cf7ea5784ce0e2223de4772ef8afa50a78d02'
AND (
token = '1bKOc3S+ccvVMZRC7IuX+0yKoL3ooNOLz2vIscghKrc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)