UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0kCW+uoqUlisyEBnIq+il/8KLy01Ns2BEd/dhT/q8KE='
WHERE
key_id = '5925a45de2f56646520a8051da6bbb36b7de0a1b59b6356b16f25694c66c9d39'
AND (
token = '0kCW+uoqUlisyEBnIq+il/8KLy01Ns2BEd/dhT/q8KE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)