UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+4XhxfAONwcgbAqTD0i2HG1368NdgjvAPfgNX0qvu7M='
WHERE
key_id = 'bfaccb96862ea968d2dcf4695278d5b566a3709077766eb1f009c4ddedf7c8bc'
AND (
token = '+4XhxfAONwcgbAqTD0i2HG1368NdgjvAPfgNX0qvu7M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)