UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3VnJv/uFYnEUNubx9wz0hJTjRYhyONwMpRsZTU49Gbc='
WHERE
key_id = '2f341810211e4a7f7bad95b29f0a84603af8fab6d66c97aa762f90ef4b75324f'
AND (
token = '3VnJv/uFYnEUNubx9wz0hJTjRYhyONwMpRsZTU49Gbc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)