UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZuFxZOPDyrgMgi59CmuGxQNb40pAXgxVUoka5mCVeOU='
WHERE
key_id = '28c654d05515165b908f01264119429c858007c3652c5450858a07b3f7c459f4'
AND (
token = 'ZuFxZOPDyrgMgi59CmuGxQNb40pAXgxVUoka5mCVeOU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)