UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PjKSrDqSn2dLAMmhdZVU5UC1j07L0b0uBNvBrOzgISA='
WHERE
key_id = '54f691b341efef9b6a15247e01b4ab4fa64800e4aee384093cb6a917d3f5cd39'
AND (
token = 'PjKSrDqSn2dLAMmhdZVU5UC1j07L0b0uBNvBrOzgISA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)