UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zo6RUdBTsuu4NbSgulzHpxoYCMJK2iyf1qEZvDkfstk='
WHERE
key_id = 'acd67253a4517d242c0818859f41feba93d49aefdb59bd6ae2d39602dc6cfbdd'
AND (
token = 'zo6RUdBTsuu4NbSgulzHpxoYCMJK2iyf1qEZvDkfstk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)