UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BdCBIQ+ePsKT25yYR2ETgI4l/vJzuFFBli+N5oNJUE4='
WHERE
key_id = '7189c511bd25f1d92e85c6b84e77ab646ae93b6ea046c748248aa61c407a9cea'
AND (
token = 'BdCBIQ+ePsKT25yYR2ETgI4l/vJzuFFBli+N5oNJUE4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)