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