UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qUFpHk+yvUumvazOGIS06Y+BdCYaIDzrw1mSWmt3pVs='
WHERE
key_id = 'ddc0b0c405d027145dd7eeb8443dc18b2ccff35bc701838b3a979e90f513b40f'
AND (
token = 'qUFpHk+yvUumvazOGIS06Y+BdCYaIDzrw1mSWmt3pVs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)