UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hP+rDTzZh9nNN7gD6S+fIztTKBdZ9I6DVwfYegzVB80='
WHERE
key_id = '955e456d6ca5e7fd998c7c08a893a151f01de78012f65f49eba2faf1d28b0281'
AND (
token = 'hP+rDTzZh9nNN7gD6S+fIztTKBdZ9I6DVwfYegzVB80='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)