UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'O63NMHrlhrDTm8/2ThKcgkhqbV9GUKH0VssoFrIpraI='
WHERE
key_id = '8b9ac780abee8ecc7c8196b7d55aa9ed44e7c8e8dfe4eea9b45bdd7c073444f8'
AND (
token = 'O63NMHrlhrDTm8/2ThKcgkhqbV9GUKH0VssoFrIpraI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)