UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TPd81lFKmuevPnTgrVesTZusQb6oooLBVDQCRk1fUNg='
WHERE
key_id = '9119f54694f6a76d801e8d7bf00419c8811c48bc2a297b871a688084ff8cad4d'
AND (
token = 'TPd81lFKmuevPnTgrVesTZusQb6oooLBVDQCRk1fUNg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)