UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7zYsXbBD8NtsX10Do+O60SRz+7PcOXBwlbC1Btx6yHY='
WHERE
key_id = '8cd9c841568d604686c8788006cdc10c7fc428928a3cbeedaaca6dadebe903aa'
AND (
token = '7zYsXbBD8NtsX10Do+O60SRz+7PcOXBwlbC1Btx6yHY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)