UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SI+aAiELsBjeC0N2VOu2C4MO9Lf+np3WTOILrgm+jGs='
WHERE
key_id = '15d6abb52c217d8d29c894f8cc3576a4467f0279ab0b783824a4cc76a1e85139'
AND (
token = 'SI+aAiELsBjeC0N2VOu2C4MO9Lf+np3WTOILrgm+jGs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)