UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XPPeGzugKrM/Of7YyFuGs9hYcm/NDNetRwSCFYm3xac='
WHERE
key_id = '82a60fd78ba0d31d7a5b2a037d75ad0092665333af604b581c58acef492e0a98'
AND (
token = 'XPPeGzugKrM/Of7YyFuGs9hYcm/NDNetRwSCFYm3xac='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)