UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yQEoZozvpGYZCEmXraO+LPVFTPEvSX2NxtcIrm1NRkU='
WHERE
key_id = '7062728285bc038730749b306c71732a4f1162d363f34b6166e7d67f03889981'
AND (
token = 'yQEoZozvpGYZCEmXraO+LPVFTPEvSX2NxtcIrm1NRkU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)