UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wGNbmSIgpRxzPktSwpBfzvqJDn+XV4KimuuHt7xxVUE='
WHERE
key_id = 'c05238aabd55522e6d3bfdcf9e39c8d3211b91f6359e07fbc2711904e75651be'
AND (
token = 'wGNbmSIgpRxzPktSwpBfzvqJDn+XV4KimuuHt7xxVUE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)