UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lla/Xvn4f3Uq3gwxVli1iQTaWkAvvbap6TK5Hd9Fpss='
WHERE
key_id = '5c7f5de8c9de69f1bc3847c8c1574d430bb4bfd02d59fc2d588556ad1a6d5b63'
AND (
token = 'lla/Xvn4f3Uq3gwxVli1iQTaWkAvvbap6TK5Hd9Fpss='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)