UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Fj7pAKyMygn+ikb2cjwin9HPN+NBTTxG850E1t0albY='
WHERE
key_id = '794369ad3a3beafd43d27bd6192c34d6da83219f0c240d536aa5812dbf5dcccd'
AND (
token = 'Fj7pAKyMygn+ikb2cjwin9HPN+NBTTxG850E1t0albY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)