UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2w05N+m5M18MJ5Uhb1oY2XS23gP9tFtMut6Pu3uETaM='
WHERE
key_id = '19af1c8487225c429936a61f02bb93d4f9778ab39e69d6e6fb9f9b51bb71d04c'
AND (
token = '2w05N+m5M18MJ5Uhb1oY2XS23gP9tFtMut6Pu3uETaM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)