UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gsreTkSkTKq4smmwXQbQHIUFLUifIaXdmX3wwBhTBi4='
WHERE
key_id = '068f4643adf16cca573440735d3edba867fc3a809b972311b230ab1e02898234'
AND (
token = 'gsreTkSkTKq4smmwXQbQHIUFLUifIaXdmX3wwBhTBi4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)