UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3JOqLz6CiBbej332VJxhGZ4R6VCzKOIgXeSfJ7kXvvE='
WHERE
key_id = '9b345b6950188651a74b558f8af23daf4e07d406784fb41b9ff3d1c1d8965cf7'
AND (
token = '3JOqLz6CiBbej332VJxhGZ4R6VCzKOIgXeSfJ7kXvvE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)